package com.heima.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.heima.common.PageResult;
import com.heima.pojo.Task;
import com.heima.pojo.TaskStatusType;
import com.heima.pojo.vo.TaskVo;
import com.heima.service.ITaskStatusTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 工单任务状态 前端控制器
 * </p>
 *
 * @author xjy
 * @since 2024-06-09
 */
@RestController
@RequestMapping("/status-service/status")
public class TaskStatusTypeController {
    @Autowired
    private ITaskStatusTypeService taskStatusTypeService;

    @GetMapping("/top10")
    @ApiOperation("工单任务状态top10")
    public List<Map<String, Object>> top10() {
        return taskStatusTypeService.top10();
    }

    @GetMapping("/trouble")
    @ApiOperation("获取故障设备")
    public PageResult<TaskVo> trouble(PageResult<TaskVo> pageResult) {
        return taskStatusTypeService.trouble(pageResult);
    }
}
